class BootStrap {

	def authenticateService
	
    def init = { servletContext ->
		
		def roleAdmin = new Permissao(authority:'ROLE_ADMIN', description:'Administradores do sistema')
		def roleUser  = new Permissao(authority:'ROLE_USUARIO', description:'Usuarios do sistema')
		
		def userGod = new Usuario(
			username:'administrador',
			userRealName :'Administrador do sistema',
			enabled : true,
			email : '',
			passwd : authenticateService.encodePassword('admin'))
		
		userGod.save()
		
		roleAdmin.addToPeople(userGod)
		
		roleAdmin.save()
		roleUser.save()
		
    }
    def destroy = {
    }
}
